package com.main.ok.test;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.greenline.epay.taikang.service.CrmCardService;
import com.greenline.epay.taikang.service.PortalCustomerApplyService;
import com.greenline.epay.taikang.service.TaikangInsuranceService;
import com.greenline.epay.taikang.service.TaikangLogService;
import com.greenline.epay.taikang.service.UserAuthenticationService;
import com.greenline.epay.taikang.service.dto.BaseResponse;
import com.greenline.epay.taikang.service.dto.CardChargeDTO;
import com.greenline.epay.taikang.service.dto.CardInfoDTO;
import com.greenline.epay.taikang.service.dto.CardValidDTO;
import com.greenline.epay.taikang.service.dto.CheckResponse;
import com.greenline.epay.taikang.service.dto.CommonUserInfoDTO;
//import com.greenline.epay.taikang.service.dto.CommonUserInfoDTO;
//import com.greenline.epay.taikang.service.dto.CommonUserInfoDTO;
import com.greenline.epay.taikang.service.dto.CustomerApplyDTO;
import com.greenline.epay.taikang.service.dto.CustomerApplyRequest;
import com.greenline.epay.taikang.service.dto.CustomerDTO;
import com.greenline.epay.taikang.service.dto.ResponseCode;
import com.greenline.epay.taikang.service.dto.ResponseDTO;
import com.greenline.epay.taikang.service.dto.ServiceDTO;
import com.greenline.epay.taikang.service.dto.ServiceLogRequest;
import com.greenline.epay.taikang.service.dto.ServiceLogRequestDTO;
import com.greenline.epay.taikang.service.dto.TaikangInsuranceRequest;
import com.greenline.epay.taikang.service.dto.TaikangInsuranceResponse;
import com.greenline.epay.taikang.service.dto.TelcomUserDTO;
import com.greenline.epay.taikang.service.dto.UserInfoRequest;
import com.greenline.epay.taikang.service.dto.UserInfoRequestDTO;
import com.greenline.epay.taikang.service.dto.query.CustomerApplyQueryDTO;
import com.greenline.epay.taikang.service.dto.query.CustomerQueryDTO;
import com.greenline.epay.taikang.service.dto.query.QueryResultDTO;

import demo.service.dubbo.UserService;

public class UserAuthServiceMain {

    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

        UserAuthenticationService userService = (UserAuthenticationService) ctx.getBean("checkLoginService");

        // CustomerQueryDTO query = new CustomerQueryDTO();
        // // query.setCustomerName("周纳兰");
        // query.setMobile("15618385153");
        // QueryResultDTO<List<CustomerDTO>> queryResult =
        // userService.queryCustomers(query);
        // List<CustomerDTO> customerList = queryResult.getDataResult();
        // if (queryResult.getCode().equals(ResponseCode.SUCCESS)) {
        // System.out.println(queryResult.getMessage());
        // for (CustomerDTO tmp : customerList) {
        // System.out.println(tmp.getPartnerId() + "--" +
        // tmp.getCustomerName());
        // }
        // } else {
        // System.out.println(queryResult.getErrorMsg());
        // }
        ResponseDTO<CustomerDTO> customerResponse = userService.queryCustomerById(4l);
        if (customerResponse.getCode().equals(ResponseCode.SUCCESS)) {
            System.out.println(customerResponse.getDataResult().getCustomerName() + "--"
                    + customerResponse.getMessage() + "--" + customerResponse.getDataResult().getSource());
        } else {
            System.out.println(customerResponse.getErrorMsg());
        }

    }
}
